<!--
 * @Author: xuzehan 123@qq.com
 * @Date: 2023-04-24 15:56:36
 * @LastEditors: xuzehan 123@qq.com
 * @LastEditTime: 2023-06-08 09:20:25
 * @FilePath: \ant-design-vue-jeecg-master\src\views\networkStatus\modules\terminalStatus.vue
 * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
-->
<!--
 * @Author: xuzehan 123@qq.com
 * @Date: 2023-04-24 15:56:19
 * @LastEditors: xuzehan 123@qq.com
 * @LastEditTime: 2023-04-27 15:40:25
 * @FilePath: \ant-design-vue-jeecg-master\src\views\networkStatus\modules\carStatus.vue
 * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
-->
<template>
  <div>
    <!-- <a-tabs default-active-key="1" @change="callback">
      <a-tab-pane key="1" tab="导弹1" force-render>
        <missileTerminal1 />
        </a-tab-pane>
      <a-tab-pane key="2" tab="导弹2" force-render>
        <missileTerminal2 />
        </a-tab-pane>
      <a-tab-pane key="3" tab="导弹3" force-render>
         <missileTerminal3 />
          </a-tab-pane>
      <a-tab-pane key="4" tab="导弹4" force-render>
        <missileTerminal4 />
         </a-tab-pane>
    </a-tabs>-->

    <!-- <a-cascader :options="options" placeholder="请选择车和导弹" @change="onChange" /> -->
    <!-- <a-select
      placeholder="请选择"
      @change="onChange"
      style="width:200px;margin-left:19px"
      v-model="terminalInfo"
    >
      <a-select-option
        :value="item.identificationCode"
        v-for="item in options"
        :key="item.id"
      >{{ item.name }} ({{item.identificationCode}})</a-select-option>
    </a-select>
    <a-button type="primary" style="margin-left: 10px" @click="handleQuery">状态查询</a-button>-->
    <!-- <a-radio-group v-model="value" @change="onChange">
      <a-radio-button v-for="(item, index) in btnList" :key="index" :value="item.value">
        {{ item.label }}
      </a-radio-button>
    </a-radio-group>-->
    <statusBox :data="data" style="margin-top: 15px" />
    <select-channel ref="selectChannel" />
  </div>
</template>

<script>
import statusBox from './components/status1.vue'
// import missileTerminal1 from './components/missileTerminal1.vue'
// import missileTerminal2 from './components/missileTerminal2.vue'
// import missileTerminal3 from './components/missileTerminal3.vue'
// import missileTerminal4 from './components/missileTerminal4.vue'
import selectChannel from './components/selectChannel.vue'

import { getAction, httpAction } from '@/api/manage.js'
export default {
  components: {
    selectChannel,
    //  missileTerminal1, missileTerminal2, missileTerminal3, missileTerminal4,
    statusBox
  },
  data() {
    return {
      value: '1-1',
      data: 'F',
      terminalInfo: undefined,
      url: {
        carlist: '/commandVehicle/nmcCommandVehicle/list',
      },
      btnList: [
        { label: '导弹1-1', value: '1-1' },
        { label: '导弹1-2', value: '1-2' },
        { label: '导弹1-3', value: '1-3' },
        { label: '导弹1-4', value: '1-4' },
        { label: '导弹2-1', value: '2-1' },
        { label: '导弹2-2', value: '2-2' },
        { label: '导弹2-3', value: '2-3' },
        { label: '导弹2-4', value: '2-4' },
        { label: '导弹3-1', value: '3-1' },
        { label: '导弹3-2', value: '3-2' },
        { label: '导弹3-3', value: '3-3' },
        { label: '导弹3-4', value: '3-4' },
        { label: '导弹4-1', value: '4-1' },
        { label: '导弹4-2', value: '4-2' },
        { label: '导弹4-3', value: '4-3' },
        { label: '导弹4-4', value: '4-4' },
      ],
      options: [
        {
          value: '车1',
          label: '车1',
          children: [
            {
              value: '导弹1',
              label: '导弹1',
            },
            {
              value: '导弹2',
              label: '导弹2',
            },
            {
              value: '导弹3',
              label: '导弹3',
            },
            {
              value: '导弹4',
              label: '导弹4',
            },
          ],
        },
        {
          value: '车2',
          label: '车2',
          children: [
            {
              value: '导弹1',
              label: '导弹1',
            },
            {
              value: '导弹2',
              label: '导弹2',
            },
            {
              value: '导弹3',
              label: '导弹3',
            },
            {
              value: '导弹4',
              label: '导弹4',
            },
          ],
        },
        {
          value: '车3',
          label: '车3',
          children: [
            {
              value: '导弹1',
              label: '导弹1',
            },
            {
              value: '导弹2',
              label: '导弹2',
            },
            {
              value: '导弹3',
              label: '导弹3',
            },
            {
              value: '导弹4',
              label: '导弹4',
            },
          ],
        },
        {
          value: '车4',
          label: '车4',
          children: [
            {
              value: '导弹1',
              label: '导弹1',
            },
            {
              value: '导弹2',
              label: '导弹2',
            },
            {
              value: '导弹3',
              label: '导弹3',
            },
            {
              value: '导弹4',
              label: '导弹4',
            },
          ],
        },
      ],
    }
  },

  created() {
    this.getCarList()
  },
  methods: {
    getCarList() {
      getAction(this.url.carlist, { pageSize: -1 }).then((res) => {
        this.options = res.result.records
      })
    },
    handleQuery() {
      let temp = { packageCode: '19导弹网络状态查询指令' }
      this.$refs.selectChannel.showModal(temp)
    },
    callback(key) {
      console.log(key)
    },
    onChange(e) {
      console.log(`checked = ${e.target.value}`)
    },
  },
}
</script>

<style></style>
